package com.tmt.im.jpa.entity;

import com.tmt.data.jpa.entity.TmtBaseEntity;
import com.tmt.data.jpa.entity.TmtBaseEntityId;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

import java.io.Serial;

/**
 * 用户银行卡表
 *
 * @Description TODO
 * @Author wuyi
 * @Date 2024/8/6 21:53
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "bank_card")
@Tag(name = "bank_card", description = "用户银行卡表")
public class BankCard extends TmtBaseEntityId {

    @Serial
    private static final long serialVersionUID = 4342833331915835630L;

    /**
     * 银行卡号
     */
    private String cardNo;

    /**
     * 银行总行名称
     */
    private String bankName;

    /**
     * 卡开户行名称
     */
    private String subBank;

    /**
     * 银行卡的拥有者
     */
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY, optional = false)
    private IMUser owner;

}
